<?php
	require '../feed/config/config.php';
	session_start();
	$_SESSION['url']="https://edu.yudur.cn/index/index.php";
	$ConnfigRs=mysqli_fetch_array(mysqli_query($con,"select * from config where id='1'"));
	if($_GET['ops']=="logout"){
	    session_destroy();
	    session_start();
	    $_SESSION['url']="https://edu.yudur.cn/index/index.php";
	    echo "<script>alert('您已成功退出');location='./index.php';</script>";
	}
?>
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8"/>
    <title>校园服务反馈系统</title>
    <script type="text/javascript" src="js/base-loading.min.js"></script>
    <script type="text/javascript" src="js/layui.js"></script>
    <link rel="stylesheet" href="css/style.css"/>
    <link rel="stylesheet" href="css/layui.css"/>
  </head>
  <body>
    <div class="s_header w">
      <div class="s_header_top w">
        <div class="header_top w1000 auto">
          <div class="header_top_fl fl">欢迎访问<?php echo $ConnfigRs['name'];?></div>
          <div class="header_top_fr fr"><span class="header_email dib"></span><span class="header_tel dib"></span>
            <div class="cb"></div>
          </div>
          <div class="cb"></div>
        </div>
      </div>
      <div class="s_header_nav w">
        <div class="header_nav w1000 auto">
          <div class="logo fl"><a href="index.html"><img src="http://www.huayu.edu.cn/template/huayu/listimages/logo.png" alt=""/></a></div>
        </div>
      </div>
    </div>
    <div class="banner">
      <div id="banner" class="dv_5"><a href="" style=" background:url(images/hy.png) center center no-repeat; display: block; z-index: 1; " class="d1"></a><a href="" style=" background:url(images/banner2.png) center center no-repeat; display: block; z-index: 1; " class="d1"></a><a href="" style=" background:url(images/banner3.png) center center no-repeat; display: block; z-index: 1; " class="d1"></a>
      </div>
    </div>
    <div class="cen_tip w">
      <div class="tip auto">
        <ul>
          <li class="first"><a href="./club" class="pr">
              <div class="tit">社团中心</div>
              <div class="entit">Community Center</div>
              <div class="pa tip_img_1"><img src="images/tip_1.png" alt=""/></div></a></li>
          <li><a href="./activity" class="pr">
              <div class="tit">活动服务</div>
              <div class="entit">Activity service</div>
              <div class="pa tip_img_2"><img src="images/tip_2.png" alt=""/></div></a></li>
          <li><a href="../feed/user/my.php" class="pr">
              <div class="tit">个人中心</div>
              <div class="entit">User Center</div>
              <div class="pa tip_img_3"><img src="images/tip_3.png" alt=""/></div></a></li>
          <li><a href="../feed" class="pr">
              <div class="tit">反馈专区</div>
              <div class="entit">Feedback zone</div>
              <div class="pa tip_img_4"><img src="images/tip_4.png" alt=""/></div></a></li>
        </ul>
      </div>
    </div>
    <div class="s_cen w">
      <div class="center w1000 auto">
        <div class="cen_one">
          <div class="cen_one_fl fl">
            <div class="jqal_top">
              <div class="jqal_top_tit fl">服务中心</div>
              <div class="cb"></div>
            </div>
            <div class="jqal_bom mychgPic">
              <div id="myFocus" class="mF_liuzg">
                <ul class="pic">
                    <li><br /></li>
                    <li><br /></li>
                    <li><br /></li>
                    <li>
                            <?php
                                if(empty($_SESSION['member'])){
                                    echo "
                                        <div align='center'>
                                            <a href='../feed/login.php'><button type='button' class='layui-btn layui-btn-normal'>登录</button></a> 
                                            &nbsp;&nbsp;
                                            <a href='../feed/register.php'><button type='button' class='layui-btn layui-btn-normal'>注册</button></a>
                                        </div>
                                    ";
                                }else{
                                    echo "<h3>欢迎您，".$_SESSION['member']." ， <a href='?ops=logout'>注销</a></h3><br /><a href='../master/login.php'>后台管理系统</a>";
                                }
                            ?>
                    </li>
                  
                </ul>
              </div>
            </div>
          </div>
          <div class="cb"></div>
        </div>
        <div class="cen_two">
          <div class="cen_two_cen fl">
            <div class="s_news_top">
              <div class="s_news_top_tit fl">活动专区</div>
              <div class="cb"></div>
            </div>
            <div class="s_news_bom">
              <div class="s_news_bom_ul">
                <ul>
                  <?php
                    $result=mysqli_query($con,"select * from activity where state='1' order by id asc");
                    $total=mysqli_num_rows($result);
                    $page=isset($_GET['page'])?intval($_GET['page']):1;  
                    $info_num=6; 
                    $pagenum=ceil($total/$info_num); 
                    $offset=($page-1)*$info_num; 
                    $activity=mysqli_query($con,"select * from activity where state='1' order by id desc limit $offset,$info_num"); 
                    if(!$activity) {
                        printf("Error: %s\n", mysqli_error($con));
                        exit();
                    }
        			while($activityRs=mysqli_fetch_array($activity)){
        			    $clubRs=mysqli_fetch_array(mysqli_query($con,"select * from club where id='".$activityRs['clubId']."'"));
        			    if($activityRs['id']!=""){
        			        echo "<li><a href='./activity/activity.php?activityId=".$activityRs['id']."'><font color='red'>【进行中】 - </font> ".$activityRs['name']."... </a></li>";
        			    }
        			}
        			echo "<br />";
        			echo "当前在第 ".$page." 页 | &nbsp;&nbsp;";
                	if( $page > 1 ){
                		echo "<a href='?page=".($page-1)."'>前一页</a>&nbsp";
                	}else{
                		echo "前一页&nbsp&nbsp";
                	}
                	for($i=1;$i<=$pagenum;$i++){
                		$show=($i!=$page)?"<a href='?page=".$i."'>".$i."</a>":"$i";
                		Echo $show." ";
                	}
                	if( $page<$pagenum){
                		echo "<a href='?page=".($page+1)."'>后一页</a>";
                	}else{
                		echo "后一页";
                	}
                  ?>
                </ul>
              </div>
            </div>
          </div>
          <div class="cb"></div>
        </div>
      </div>
    </div>
    <div class="s_footer w">
      <div class="footer w1000 auto">
        <div class="footer_fl fl">
          <div class="footer_logo"><a href=""><img src="http://www.huayu.edu.cn/template/huayu/images/logo.png"  alt="" width="100%"/></a></div>
          <div class="footer_line"></div>
          <div class="footer_fl_ul">
            
          </div>
          <div class="cb"></div>
          <div class="footer_fl_record"></div>
        </div>
        <div class="footer_fr fr">
          <div class="footer_fr_top"></div>
          <div class="footer_line"></div>
         
          <div class="footer_from">｜<a href="" target="_blank">XXX</a></div>
        </div>
      </div>
    </div>
    <script type="text/javascript" src="js/jquery-1.8.1.min.js"></script>
    <!--首页banner特效-->
    <script type="text/javascript" src="js/banner.js"></script>
    <script type="text/javascript" src="js/main.js"> </script>
    <script type="text/javascript" src="js/jquery.SuperSlide.2.1.1.js"></script>
</body>
</html>